import React from 'react';
import {connect} from 'react-redux';
import * as actions from '@/store/actions/middleware'

class Persist extends React.Component{
    constructor(props){
        super(props);
        this.state={
            name:'Jaasdsa persist',
            age:16
        }
    }
    render(){
        console.log('persist-render');
        return(
    <div>
        <h6>Persist</h6>
        <h6>{this.state.name}---{this,this.state.age}</h6>
        <button onClick={()=>{this.setState({name:'stella persist'})}}>class组件状态</button>
        <h6>{this.props.age}</h6>
        <button onClick={()=>{this.props.increment()}}>同步+1</button>
    </div>
        )
    }
}

export default connect(
    state=>state.test,
    actions
)(Persist);